In U.S. Pat. No. 6,163,780, the Hewlett-Packard Company of Palo Alto, Calif. describe a system for concentrating executable computer software code. This system involves parsing the computer software code by means of concentrating software. The concentrating software achieves this by a series of scans of the computer software code.
The first scan identifies all unique classes referenced in the computer software code and includes the identifier of each such class into a “ClassList”. The second scan searches for all unique methods (the identifiers of which are stored in a “MethodList”) and the third scan searches for all unique Fields (the identifiers of which are stored in a “FieldList”).
Every class identified in the ClassList is then scanned to determine whether there are references to further classes not recorded in the ClassList. If so, then the identifier for such classes is added to the ClassList. The process is then repeated in relation to the newly added classes. In this manner, all unique classes referenced in the computer software code are identified in the ClassList.
Once this scan has been completed, every class in the ClassList is again scanned, but this time to determine any further methods not recorded in the MethodList. If a method is found that is not included in the MethodList, then the identifier for the method is added to the MethodList. The process continues until all classes in the ClassList have been scanned for further methods.
A further scan is used to identify all further fields not included in the FieldList and add their identifier to the FieldList. This scan involves traversing all classes in the ClassList and every method in these classes to identify further fields. The ClassList, MethodList and FieldList are then each sorted and reformatted into a canonical list form. Each class, method and field in the ClassList, MethodList and FieldList, respectively, is also assigned a unique index reference (typically an integer corresponding to the position of the corresponding identifier within the appropriate canonical list).
Local data referenced by each method of each class are then stored in an array for each class. The local data reference in each method is then replaced with the index value of the location of the local data in the array. The computer software code can then be executed with class, method and field invocations being resolved as part of the execution process.
The problem with this arrangement is that the use of index references to corresponding canonical lists hinders upgrading of the computer software code. To illustrate, if an upgrade requires a class to be added, deleted or changed, then all the index values of classes in the condensed computer software code may be affected in such a manner that parts of the bytecode invoke the wrong class, method or field during execution.
Further, if the condensed computer software code is burned into a ROM, any change in the computer software code will require the ROM to be refreshed. This may not be possible, however, if the device is in the hands of the end-users.
Accordingly, there is a need to record only the information necessary to perform the upgrade and to use this information together with computer software code concentrated according to the system described above.